package cn.flying.base.process.listener.handler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.flying.base.process.mapper.ProcessExceptionMapper;
import cn.flying.base.process.model.CfProcException;

/**
 * @description: 异常监听处理类
 * @author: lvyong
 * @date: 2023年02月22日 23:22
 * @version: 1.0
 */
@Service
public class JobExecutionFailureListenerHandler {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private ProcessExceptionMapper processExceptionMapper;

    @Transactional(rollbackFor = Exception.class)
    public void execute(CfProcException procException) {
        processExceptionMapper.insert(procException);
    }
}
